package com.itheima.zhuanhuan;

import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.Charset;

public class Demo02 {

    public static void main(String[] args) throws IOException {
        //FileReader reader = new FileReader("D:\\abc.txt", Charset.forName("GBK"));
        InputStreamReader reader = new InputStreamReader(new FileInputStream("d:\\abc.txt"),"GBK");
        int c ;
        while ((c=reader.read())!=-1){
            System.out.println((char)c);
        }
        reader.close();
    }
}
